package com.kuaidao.sys.service.dictiondry.impl;

import com.github.pagehelper.PageHelper;
import com.kuaidao.common.mapper.IBaseCRUD;
import com.kuaidao.common.service.AbstractBaseService;
import com.kuaidao.sys.dto.dictionary.DictionaryItemReqDTO;
import com.kuaidao.sys.dto.dictionary.DictionaryItemResDTO;
import com.kuaidao.sys.entity.user.DictionaryEdition;
import com.kuaidao.sys.mapper.user.DictionaryEditionMapper;
import com.kuaidao.sys.service.dictiondry.IDictionaryEditionService;
import com.kuaidao.sys.service.dictiondry.IDictiondryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author Hao
 **/
@Service
public class IDictionaryEditionServiceImpl extends AbstractBaseService<DictionaryEdition,Long> implements IDictionaryEditionService<DictionaryEdition,Long> {

    @Autowired
    private DictionaryEditionMapper dictionaryEditionMapper;


    @Override
    protected IBaseCRUD<DictionaryEdition, Long> getBaseCRUD() {
        return (IBaseCRUD)dictionaryEditionMapper;
    }

    @Override
    public List<DictionaryItemResDTO> findDictionaryItemsByPage(DictionaryItemReqDTO dictionaryItemReqDTO) {

        PageHelper.startPage(dictionaryItemReqDTO.getPageNum(),dictionaryItemReqDTO.getPageSize());

        return dictionaryEditionMapper.findDictionaryItemsByPage(dictionaryItemReqDTO);
    }
}
